package reflect;

import java.util.Scanner;

public class RefelectDemo2 {
    public static void main(String[] args) throws ClassNotFoundException, InstantiationException, IllegalAccessException {
        Scanner scanner = new Scanner(System.in);
        System.out.print("请输入类名:>");
        String name = scanner.nextLine();
        Class<?> c = Class.forName(name);
        Object obj = c.newInstance();
        System.out.println(obj);
    }
}
